// -----------------------------------------------------------------------
//  <copyright file="DictionaryItemByKeywordSpec.cs" company="LiuliuSoft">
//      Copyright (c) 2025 66SOFT. All rights reserved.
//  </copyright>
//  <site>https://dapr.plus</site>
//  <last-editor>郭明锋</last-editor>
//  <last-date>2025-10-17 01:10</last-date>
// -----------------------------------------------------------------------

using DaprPlus.DataDicts.Domain.Entities;


namespace DaprPlus.DataDicts.Domain.Specs;

public class DictionaryItemByTypeCodeAndKeywordSpec : SpecificationBase<DictionaryItem>
{
    public DictionaryItemByTypeCodeAndKeywordSpec(string typeCode, string? keyword) : base(m =>
        m.DictionaryType.Code == typeCode
        && (keyword == null || m.Label.Contains(keyword) || m.Value.Contains(keyword)))
    {
        AddOrderBy(m => m.Order);
    }
}
